package com.orhon.smartcampus.modules.base.mm;


import com.orhon.smartcampus.modules.base.entity.Grades;
import com.orhon.smartcampus.modules.base.entity.Textbooks;
import com.orhon.smartcampus.modules.base.gqlModel.GQLGrades;
import com.orhon.smartcampus.modules.base.gqlModel.GQLTextbooks;
import com.orhon.smartcampus.modules.student.mm.EclassMapper;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper(
        uses = {
                LangMapper.class,
        }
)
public interface TextbookMapper {

    TextbookMapper MAPPER = Mappers.getMapper(TextbookMapper.class);

    @Mapping(source = "id" , target = "id")
    @Mapping(source = "textbookVersionId" , target = "textbookVersionId")
    @Mapping(source = "periodId" , target = "periodId")
    @Mapping(source = "subjectId" , target = "subjectId")
    @Mapping(source = "textbookNumber" , target = "textbookNumber")
    @Mapping(source = "userId" , target = "userId")
    @Mapping(source = "schoolId" , target = "schoolId")
    @Mapping(source = "belong" , target = "belong")
    @Mapping(source = "reportNum" , target = "reportNum")
    @Mapping(source = "courseId" , target = "courseId")
    @Mapping(source = "shareStatus" , target = "shareStatus")
    @Mapping(source = "mark" , target = "mark")
    @Mapping(source = "textbookName" , target = "textbookName")
    GQLTextbooks toTextbook(Textbooks entity);
    
    @InheritConfiguration(name = "toTextbook")
    List<GQLTextbooks> toTextbookList(List<Textbooks> entities);
}
